import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ClassManager classManager = new ClassManager();
        GroupManager groupManager = new GroupManager();
        StudentManager studentManager = new StudentManager();
        RandomPicker randomPicker = new RandomPicker(classManager, groupManager, studentManager);

        while (true) {
            System.out.println("欢迎使用班级管理系统");
            System.out.println("1. 班级管理");
            System.out.println("2. 小组管理");
            System.out.println("3. 学生管理");
            System.out.println("4. 随机点名");
            System.out.println("0. 退出");
            System.out.print("请选择操作: ");
            int choice = scanner.nextInt();
            scanner.nextLine(); // 清除换行符

            switch (choice) {
                case 1:
                    classManager.manageClasses(scanner);
                    break;
                case 2:
                    groupManager.manageGroups(scanner);
                    break;
                case 3:
                    studentManager.manageStudents(scanner);
                    break;
                case 4:
                    randomPicker.randomPick(scanner);
                    break;
                case 0:
                    System.out.println("退出系统");
                    return;
                default:
                    System.out.println("无效选择，请重试");
            }
        }
    }
}